<?php
require('../../../lib/base.php');
$base=new base('web');
$code=$base->get('code',true);
$helper=$base->library('helper');
if(strlen($code)!=16){
	$helper->SMessage(5,$base->config['Site']['domain'],"no","参数错误,5秒后返回首页.","script");
}else{
	$member=$base->model('member');
	$affected=$member->UMember(array('set'=>array('locked ='=>0),'where'=>array('visits ='=>0,'locked ='=>1,'`key` ='=>$code)));
	if($affected==1){
		$helper->SMessage(5,domain.'view/Login.php',"yes","帐号激活成功，5秒钟后转到登陆页.");
	}else{
		$helper->SMessage(5,domain.'view/Login.php',"no","已激活或参数错误.，5秒钟后转到登陆页.");
	}
}
?>